<template>
    <span>
        <!-- <button>{{til||'按钮'}}</button> -->
        <button @click='click'>
            <slot></slot>
        </button>
    </span>
</template>
<script>
// @ is an alias to /src
export default {
    name: 'my-button',
    props:['qqq','til'],// 通过qqq把父组件传进来的数据 接过来
    data() {
        return {
            str:"hello world"
        }
    },
    created() {
        console.log(this)
        // this.$emit('自定义事件的名','[要传给事件的所有参数]')
        this.$emit('qqq',this.str)
    },
    methods: {
        click(){
            this.$emit('click')
        }
    },
    components: {
        
    }
}
</script>
<style lang="less">

</style>